import { reactive, effect } from '../packages/reactivity/src/index';

// 声明响应式数据 obj
const obj = reactive({
  name: 'Vue源码学习',
});

console.log(obj.name);

// obj.name = 'effect原理实现';

// 调用 effect 方法
effect(() => {
  //@ts-ignore
  document.querySelector('#app').innerText = obj.name;
});

effect(() => {
  //@ts-ignore
  document.querySelector('#app2').innerText = obj.name;
});

setTimeout(() => {
  obj.name = 'effect数据变化';
}, 2000);

